package huoye.shops.huoye.message.adapter;

import android.content.Context;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.codeideology.android.widget.recycler.RecyclerViewAdapter;

import butterknife.BindView;
import huoye.shops.R;
import huoye.shops.huoye.message.model.MessageShowData;
import huoye.shops.huoye.operation.model.ManageEventData;
import huoye.shops.widget.RoundImageView;


/**
 * Created by uesr on 2018/8/10.
 */

public class MessageAdapter extends RecyclerViewAdapter<MessageAdapter.ViewHolder,MessageShowData> {



    public MessageAdapter(Context context) {
        super(context, R.layout.item_message);
    }

    @Override
    protected ViewHolder initViewHolder(View view, int i) {

        return new ViewHolder(view);
    }

    @Override
    protected void bindView(ViewHolder holder, MessageShowData data, int i) {

        holder.tvState.setText(data.getMsgTitle());
        holder.tvDetails.setText(data.getMsgContent());
        holder.tvTime.setText(data.getSendTime());
        holder.view.setSelected(data.isView());

    }


    public class ViewHolder extends RecyclerViewAdapter.ViewHolder {
        @BindView(R.id.item_massage_view)
        View view ;


        @BindView(R.id.item_massage_tv_event_state)
        TextView tvState;

        @BindView(R.id.item_massage_tv_event_details)
        TextView tvDetails;

        @BindView(R.id.item_massage_tv_event_time)
        TextView tvTime;


  ;


        public ViewHolder(View itemView) {
            super(itemView);
        }
    }



    public void setOnManageEventDataListener(OnManageEventDataListener onManageEventDataListener) {
        this.listener = onManageEventDataListener;
    }

    private OnManageEventDataListener listener;

    public interface OnManageEventDataListener {

        void onJoinClick(ManageEventData ManageEventData);
        void onDetailsClick(ManageEventData ManageEventData);
        void onBuildClick(ManageEventData ManageEventData);


    }

}
